var k_edit = true;
$(window).load(function(){
       $('a').click(function(event){
		 event.preventDefault();
		  }); 	
  		CKEDITOR.on( 'instanceReady', function( evt ) {
			var editor = evt.editor;
			CKFinder.setupCKEditor( editor, { basePath : '/ckfinder/', skin : 'v1' } ) ;
			
		});
 	$('.dashboard').click(function(event){
  	 window.location = "/admin/dashboard/";
   	});
  	$('.go-back').click(function(event){
	  	window.history.back();
   	});
   	$('.forsubmit').click(function(event){
   		var data = [];
   		if ($('.topedit2').length >0 ){
   			data.concat()
   			$('.topedit2 :input').serializeArray();
   		}
   		console.dir(data);
   		
   	 return;	
  	 var ckvalue = CKEDITOR.instances.editor1.getData();
 	 		$.ajax({
			type : "POST",
			data :  {'content':ckvalue,'tid' : tid},
			dataType : "json",
			success : function(data){		
				if(data && data.state && (data.state.indexOf("ERROR") != -1)){
	
					return;	
				}else{
					alert("update successfully");				 	
				}
			}
		});	
  	});
});